Tim Deegan [Tue, 17 Oct 2006 10:07:11 +0000 (11:07 +0100)]
[XEN] Don't kill shadowed guest for writing bogus PTEs.
If a guest writes a "bad" pagetable entry and we fail to unshadow the
page, don't kill the guest. This makes the behaviour the same as
if the bad PTE were already in place when we shadowed the page.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
[SHADOW] Trivial whitespace fix to a couple of printf format strings.
From: Brendan Cully <brendan@cs.ubc.ca> Signed-off-by: Keir Fraser <keir@xensource.com>
[XEND] Check for and fail on non-existent floppy-drive file when starting HVM guest.
The qemu device model hangs when a non-existent floppy file is passed
via 'fda' or 'fdb'. The attached patch checks whether the floppy file
exists and raises an error if it does not.
[NET] back: Simplify probing of new interfaces. There's no need
to watch for creation of the handle node in xenstore, as it is
written by xend when creating the backend directory as part of
the same transaction. Signed-off-by: Keir Fraser <keir@xensource.com>
[HVM][SVM] Check if SVM is disabled by the BIOS before enabling it.
Newer BIOS implementations will be able to disable the SVM feature,
although an additional test of an MSR (VMCR 0xC0010114 bit 4) is
necessary (set equals disabled). Bit 4 of MSR 0xc0010114 returns 0
(SVM enabled) on machines with older BIOS' without the SVM disable
feature support.
Signed-off-by: Wei Huang <wei.huang2@amd.com>=20 Signed-off-by: Tom Woller <thomas.woller@amd.com>=20
Fix privcmd mmap() on 64b architectures for regions larger than 2GB. Signed-off-by: Xin Li <xin.b.li@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
[IA64] Add support for enforcing singleshot mmap() semantics at the
privcmd interface.
From: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Keir Fraser <keir@xensource.com>
[xenstore] Don't limit the number of concurrent transactions for domain0 connections
since both xend and the xenstore-* utilities used in the hotplug
scripts can easily reach the limit and we trust them anyway.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
Tim Deegan [Thu, 12 Oct 2006 10:08:48 +0000 (11:08 +0100)]
[XEN] Fix race in shadow invlpg
This fixes a crash under mmstress in SMP linux guests, where one vcpu
could remove shadow entries when another was reading them for invlpg. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Tim Deegan [Mon, 9 Oct 2006 15:43:09 +0000 (16:43 +0100)]
[XEN] Zero PAE shadow l3es when destroying subshadows.
Normally, we can leave the contents of shadows in place when we destroy
them, but this is not the case for l3 subshadows, since they do not get
zeroed on reallocation unless the entire l3 page is unshadowed.
This fixes several crashes seen with SMP PAE HVM RHEL4.2 guests. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
[XEND] No need to decompress the initrd when building a domain.
The guest OS should be capable of parsing an image file in
whatever format was produced by that OS's tools. Furthermore,
we have seen initrd images with trailing garbage. This causes
us to calculate the wrong size for the uncompressed data and hence
fail to build the guest. Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX] Various fixes for mmapping I/O and foreign memory pages.
First, auto-translate guests can use remap_pfn_range() rather than
direct_remap_pfn_range(). This actually works better because
remap_pfn_range() can legitimately assert VM_PFNMAP (this patch
removes this flag for direct_remap_pfn_range().
There are various cleanups and fixes to the privcmd interface:
1. VMAs should be searched and used under the mmap semaphore
2. Mapping should be single shot (since cirect_remap_pfn_range()
expects the PTEs to be empty when it is called).
3. Demand-fault population of the privcmd vma should be disallowed.
4. Various others, including a more thorough check of input args.
Tim Deegan [Mon, 9 Oct 2006 09:18:11 +0000 (10:18 +0100)]
Since shadow_update_paging_modes() will modify v->arch.hvm_vcpu.hw_cr3,
so we should always do shadow_update_paging_modes() before we writes to
GUEST_CR3 with v->arch.hvm_vcpu.hw_cr3.
Signed-off-by: Xiaohui Xin xiaohui.xin@intel.com Signed-off-by: Xin Li <xin.b.li@intel.com>
[BALLOON] Replace alloc_empty_page_range with new helper alloc_empty_pages_and_pagevec.
This is a better fit with all the callers, who now allocate discontiguous empty pages. Signed-off-by: Keir Fraser <keir@xensource.com>
Although in the correct spirit, it seems there is some other
dependency in the code that assumes ExtInts are queued until
thay can be immediately delivered (EFLAGS.IF==1). This patch
therefore caused instability in Linux guests.
[NET] back: Remove unused rx_mmap area. Copying happens inside Xen, so
there is no need for a mapping area inside the driver for copying
receive path. Signed-off-by: Keir Fraser <keir@xensource.com>
[BLK] back: Allocate pages for foreign mappings individually rather
than in one large contiguous region. Signed-off-by: Keir Fraser <keir@xensource.com>
Make sure that if one of the intermediate steps fails, a subsequent
make invocation doesn't think there's nothing to do.
This should be viewed as an intermediate step towards splitting up
the rule into three independent ones, passing intermediate files
from one to the next.
Tim Deegan [Thu, 5 Oct 2006 15:21:39 +0000 (16:21 +0100)]
[VMX] Remove vcpu->arch.hvm_vmx.cpu_state
The flags in hvm_vmx.cpu_state were shadows of shadows of bits in
guest CR0_READ_SHADOW, CR4_READ_SHADOW and EFER, and were not being
kept in sync with the other shadows if changes were made while
running under vmxassist. Just use the full shadows of those control
regs instead, and replace cpu_state with a single vmxassist flag.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
[XEND] Fix pygrub when run server-side on a domain with blktap disks.
For some slightly-crazy reason the blktap patches changed the name
of the SEXPR block containing the disk definition 'vbd' to 'tap', even
though merely changing the 'uname' fragement was sufficient. eg
If you create a domain with xm, then xm runs pygrub client side which
works fine. If you create a domain by feeding a block of SEXPR to Xend
over its network port, then pygrub is run server side. The code in
XenD which decides which disk to run pygrub against only looks for
'device/vbd' in the SEXPR so fails to see any blktap disks.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
[NET] front: Fix size of grant_rx_ref[]. It should use the RX ring
size, rather than the TX ring size. Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com>
[HVM/vncserver] Implement a 'vnclisten' option to limit the interface
that the VNC server from qemu listens on.
Defaults to only listen on 127.0.0.1
The old behaviour (listen on all interfaces) can be restored, by
- changing the system-wide default in /etc/xen/xend-config.sxp by adding:
(vnc-listen '0.0.0.0')
- changing individual domain config files by adding:
vnclisten="0.0.0.0"
Also allows specifying the hostname associated with an interface to limit
to that interface.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
[BLKTAP] Blktapctrl: Add asynchronous watch on dom0 name entry for blktapctrl on startup. This patch cleans up the synchronisation issues between blktapctrl and xend at initialisation if the Dom0 entries have not yet been populated.
[NET] back: Disable packet queuing when a client has no receive buffers.
This turns out to be dangerous as packets can be queued indefinitely,
introducing resource dependencies between guests (if the queued
packets originate from another virtual machine). For example, this
can prevent interfaces from being torn down and hence defunct
virtual machines from being destroyed.
The queuing functionality is retained as a module option, but a
warning is printed if it is enabled. It is not intended for general use!
[XEND] If 'vncused' is set, it won't specify an explicit display num to QEMU.
In the current xen-unstable.hg tree tough, XenD will always pass an
explicit '-vnc <display num>' parameter to qemu-dm, regardless of
whether 'vncunused' is set. So the 'vncunused' bit only takes effect
if the explicitly passed display already has something bound to it.
Consider what happens when the host machine has been up for a while -
the Domain ID's start getting very high. This plays havoc with
firewalls - for example an admin may know that only 10 domains will
ever be running at any time, so they should be able to simply open up
ports 5900 -> 5910.
The correct behaviour should be:
- If 'vncdisplay' is set, use that explicit display
- If 'vncunused' is set non-zero, allocate first port about 5900
- Allocate fixed port based on domain-ID
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
[NET] Make MAX_SKBUFF_ORDER page-size independent.
Original patch from Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Keir Fraser <keir@xensource.com>
Alastair Tse [Tue, 3 Oct 2006 09:48:07 +0000 (10:48 +0100)]
[XM] Fix missing security check in block-attach
This patch fixes an indentation error in main.py. The effect of this
bug is that block-attach does not check labels if the ACM is
active. This bug slipped in with change set 11572_:_ ad22c711ccb7
<http://xenbits.xensource.com/xen-unstable.hg?cs=ad22c711ccb7>.
[HVMLOADER] Clean up SMBIOS table-length computations.
It's easier and less prone to error not to attempt the
length computation up front. Signed-off-by: Keir Fraser <keir@xensource.com>
Steven Smith [Mon, 2 Oct 2006 12:45:44 +0000 (13:45 +0100)]
[XEN][HVM] Fix a bug which could lead to the guest locking up if it
tried to a backwards memcpy across a page boundary in an MMIO region.
This should fix the problems some people have been reporting running
vim.
[HVM] Mov to/from CR8 must be gated on whether VLAPIC device is created.
If APIC=0 in VMX configuration file, VLAPIC(v) in
mov_from_cr()/mov_to_cr() will be NULL, so calling
vlapic_get_reg()/vlapic_set_reg()/vlapic_update_ppr()
would crash Xen.
Original patch from Dexuan Cui <dexuan.cui@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
[HVM][SVM] Do not delay ExtInt event injection if RFLAGS.IF==0.
AMD-V does not require the delaying of interrupt injection if the guest
IF_FLAG disallows interrupts. Remove the code in svm_intr_assist()
that was checking the guest IF in eflags.
This patch fixes the problem with HVM Windows guests, with observing a
very slow timer countdown on the initial boot menu, when there is more
than one boot option. Kbd response in this same Windows boot menu is
also acceptably responsive with this patch.
Signed-off-by: Tom Woller <thomas.woller@amd.com>=20
Steven Smith [Fri, 29 Sep 2006 14:40:19 +0000 (15:40 +0100)]
[XEN][HVM] Arrange that we only consider sending a PV-on-HVM event channel
callback interrupt in vcpu 0. This avoids a race in SMP HVM domains
which could lead to interrupts never getting delivered. It is safe
because HVM domains always bind their event channels to vcpu 0.
Steven Smith [Fri, 29 Sep 2006 13:42:04 +0000 (14:42 +0100)]
[XEN][HVM] Make sure that the interrupt which event channel events come in
on is level triggered rather than edge triggered, since it's a PCI device.
This is complicated by the possibility that another PCI device could be
on the same interrupt; the workaround is to have two irr registers
for the PIC and APIC, and have qemu and Xen generated interrupts go
into different ones.
This broke the alt_irq stuff. Fortunately, nobody uses that anymore, so
I've removed it.
The current Xen code keeps X86_CR4_VMXE set even if VMXON has not been
executed. The stop_vmx() code assumes that it is possible to call
VMXOFF if X86_CR4_VMXE is set which is not always true. Calling VMXOFF
without VMXON results in an illegal opcode trap, and to avoid this condition
this patch makes sure that X86_CR4_VMXE is only set when VMXON has
been called.
[HVM][SVM] 64-bit Windows HVM guests require MCE/MCA CPUID bits to be present.
This SVM patch removes "masking off" of these bits for AMD-V HVM guests. Signed-off-by: Tom Woller <thomas.woller@amd.com>=20
[BLKTAP] Remove unnecessary TLB flush from blktap driver.
blktap_poll is calling tlb_flush_all() in its main ring buffer polling
loop. This seems to be superfluous: the hypervisor should be
performing
any necessary tlb flushes on grant table operations performed by the
back-end. Even a simple memory barrier is unnecessary here as the
RING_PUSH_REQUESTS() call performs a wmb() anyway.
And tlb_flush_all() is not exported to modules, so this call prevents
blktap from building as a module. Just remove it.
[BLKTAP] Remove unnecessary timeout from tapdisk select() call.
tapdisk was using a 1msec select() timeout in its main event loop. On
timeout, the loop does nothing except repeat, so the timeout achieves
nothing; worse, on a machine with HZ set to less than 1000, a msec
timeout returns immediately, sending tapdisk into a 100%-CPU-
utilisation loop.
Simply remove the timeout entirely; everything still works fine, and
much more efficiently when idle.